package com.guoheng.hazard.sys.service.impl.hazard;

import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guoheng.hazard.common.base.Result;
import com.guoheng.hazard.common.enums.ErrorCodeEnum;
import com.guoheng.hazard.manager.websocket.WebSocketServer;
import com.guoheng.hazard.sys.mapper.hazard.MajorHazardAlarmMapper;
import com.guoheng.hazard.sys.model.dto.hazard.MajorHazardAlarmSelectDTO;
import com.guoheng.hazard.sys.service.hazard.MajorHazardAlarmService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.Date;
import java.util.List;

/**
 * 类功能描述:　MajorHazardAlarmServiceImpl
 *
 * @author fbl
 * @date 2019-37-23 18:37
 */
@Service
public class MajorHazardAlarmServiceImpl implements MajorHazardAlarmService {

    @Resource
    private MajorHazardAlarmMapper majorHazardAlarmMapper;


    @Override
    public Result getAlarm(Long entprId, String entprName, Integer alarmType, Date alarmStartTime, Date alarmEndTime, Integer alarmStatus, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<MajorHazardAlarmSelectDTO> alarm = majorHazardAlarmMapper.getAlarm(entprId, entprName, alarmType, alarmStartTime, alarmEndTime, alarmStatus);
        PageInfo<MajorHazardAlarmSelectDTO> majorHazardAlarmSelectDTOPageInfo = new PageInfo<>(alarm);
        return Result.success(majorHazardAlarmSelectDTOPageInfo);
    }



}
